module Custom {
	
	export class SceneMngDispatcher extends egret.EventDispatcher {

	    static lock: boolean = true;
	    private static _instance: SceneMngDispatcher; 

	    public constructor() {
	        if (SceneMngDispatcher.lock) throw "please use ins()";
	        super();
	    }

	    // 注意此处是public static, this指向Dispatcher类, 而不是它的实例
	    // 因此, _instance必须定义为静态成员才能获取
	    public static get ins(): SceneMngDispatcher {
	        if (this._instance == null || this._instance == undefined) {
	            SceneMngDispatcher.lock = false;
	            this._instance = new SceneMngDispatcher();
	            SceneMngDispatcher.lock = true;
	        }
	        return this._instance;
	    }
	}
}